#include "processbar.h"

char flag[10] = {'-', '\\', '|', '/', '\0'};

char bar[101] = {'0'};

void processbar(double rate)
{

   // usleep(10000);
    static int num = 0;
    int n = strlen(flag);
    int sum = (int)rate;
    bar[sum] = '=';
    printf("[%-100s][%6.2lf%%][%c]\r",bar, rate, flag[(num++) % n]);
    fflush(stdout);
	
}
